/*
 * @Author: zhangfeng
 * @Date: 2024-01-12 16:30:10
 * @LastEditTime: 2024-01-17 17:25:10
 * @LastEditors: zhangfeng
 * @Description:
 * @FilePath: \manager\managersystem\src\api\article.ts
 * © 2023 张峰，All rights reserved.
 */
import request from '../utils/request';

export const createArticle = (query: ArticleQuery) => {
	return request({
		url: '/article',
		method: 'post',
		data: query,
	});
};

export const getArticle = () => {
	return request({
		url: '/article',
		method: 'get',
	});
};

export const updateArticle = (data: ArticleQuery) => {
	return request({
		url: '/article',
		method: 'patch',
		data: data,
	});
};

export const deleteArticle = (id: number) => {
	return request({
		url: '/article',
		method: 'delete',
		data: { id: id },
	});
};

export const uplaodArticle = (formdata: FormData) => {
	return request({
		url: '/article/upload',
		method: 'delete',
		data: formdata,
	});
};
